import request from '/@/utils/request';

// 查询用户的消费券列列表
export function listVoucher(query?: Object) {
  return request({
    url: '/module/user/voucher/list',
    method: 'get',
    params: query
  })
}

// 查询用户的消费券列详细
export function getVoucher(id?: number) {
  return request({
    url: '/module/user/voucher/' + id,
    method: 'get'
  })
}

// 新增用户的消费券列
export function addVoucher(data?: Object) {
  return request({
    url: '/module/user/voucher',
    method: 'post',
    data: data
  })
}

// 修改用户的消费券列
export function updateVoucher(data?: Object) {
  return request({
    url: '/module/user/voucher',
    method: 'put',
    data: data
  })
}

// 删除用户的消费券列
export function delVoucher(id?: number) {
  return request({
    url: '/module/user/voucher/' + id,
    method: 'delete'
  })
}

// 导出用户的消费券列
export function exportVoucher(query?: Object) {
  return request({
    url: '/module/user/voucher/export',
    method: 'get',
    params: query
  })
}
